package chapter7.quarter3;

import java.io.*;

public class BufferedReaderTest {
    public static void main(String[] args) {
        try {
            BufferedReader in=new BufferedReader(new FileReader("myAccount2.txt"));
            BankAccount aBankAccount=new BankAccount();
            aBankAccount.setOwnerName(in.readLine());
            aBankAccount.setAccountNumber(Integer.parseInt(in.readLine()));
            in.read();
            aBankAccount.deposit(Float.parseFloat(in.readLine()));
            in.close();

            System.out.println(aBankAccount);
            System.out.println(aBankAccount.getOwnerName()+" "+aBankAccount.getAccountNumber()+" "+aBankAccount.getBalance());
        } catch (FileNotFoundException e) {
            e.printStackTrace();

        } catch (EOFException e){
            e.printStackTrace();
        }catch (IOException e) {
            e.printStackTrace();
        }
    }
}
